<template>
   <div class="header">
            <!-- logo -->
            <div class="logo">
                <img src="../assets/logo01.png" alt="">
                <img src="../assets/logo02.png" alt="">
            </div>
            <!-- 导航 -->
            <div class="nav ">
                <ul class="ul_nav">
                    <li>
                        <router-link to="/home" active-class="jihuo">首页</router-link>
                    </li>
                    <li>
                        <router-link to="/nav1" active-class="jihuo">概况</router-link>
                    </li>
                    <li>
                        <router-link to="/nav2" active-class="jihuo">资源</router-link>
                    </li>
                    <li>
                        <router-link to="/nav3" active-class="jihuo">服务</router-link>
                    </li>
                    <li>
                        <router-link to="/nav4" active-class="jihuo">互动</router-link>
                    </li>
                    <li>
                        <router-link to="/nav5" active-class="jihuo">我的</router-link>
                    </li>
                </ul>
            </div>
            <!-- 用户 -->
            <div class="nav1">
                <a><div class="user">
                    <img src="../assets/user.png" alt="">&nbsp;
                    <span>user</span>
                </div></a>
                <div class="down-menu" style="visibility: hidden;">
                    <span @click="upload">上传文件</span>
                    <span>编写文章</span>
                </div>
            </div>
        
        <!-- 弹窗，遮罩层 -->
        <div class="zhe" v-if="flag">
    <div class="tc">
        <form>
            <div>
                标题：<input type="text" name="title" id="">
            </div>
            <div>
                文件所属模块：<select name="module">
                <option value="wen1">文件1</option>
                <option value="wen2">文件2</option>
                <option value="wen3">文件3</option>
                <option value="wen4">文件4</option>
                </select>
            </div>
            <button class="btn1" @click="quxiao">取&nbsp;&nbsp;消</button>
            <button class="btn2">确&nbsp;&nbsp;认</button>
        </form>
    </div>
</div>
        </div>
</template>

<script>
export default {
    data(){
        return {
            flag:false
        }
    },
    methods:{
        upload(){
            this.flag=true
        },
        quxiao(){
            this.flag=false
        }
    }
}
</script>

<style>
    
.header {
    width: 100%;
    height: 50px;
    margin-bottom: 30px;
    /* margin: 30 auto; */
    /* background-color: rgb(10, 204, 136); */
}

.logo {
    margin: 5px 5px 0px 10px;
    float: left;
}

.nav {
    margin: 25px 75px 0px 30px;
    float: left;
    height: 42px;
    /* background-color: pink; */
}

.nav li {
    float: left;
    margin-right: 60px;
}

.nav li a {
    /* 将a标签装换成块级元素使其能修改高度 */
    display: block;
    height: 42px;
    line-height: 42px;
    font-size: 18px;
    color: #000;
}

.nav li a:hover {
    border-bottom: 1px solid skyblue;
}
.jihuo{
    border-bottom: 1px solid skyblue;
}


.user img {
    /* 图片垂直居中 */
    width: 35px;
    height: 35px;
    border-radius: 50%;
    vertical-align: middle;
}

.nav1 {
    position: relative;
    float: right;
    margin-top: 20px;
    margin-right: 35px;
    height: 42px;
    line-height: 40px;
    font-size: 20px;
}




.nav1 .down-menu:hover, .nav1 a:hover+.down-menu {
    visibility: visible !important;
    max-height: 200px;
    opacity: 1;
}

.nav1 .down-menu {
    color: rgb(56, 51, 51, .7);
    visibility: hidden;
    padding: 10px 15px;
    border-radius: 10px;
    background-color: #fff;
    box-shadow: 0 2px 5px 1px rgba(0,0,0,.2);
    width: 150px;
    position: absolute;
    top: 45px;
    right: 0px;
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0;
    max-height: 0;
    transition: all .5s;
    overflow: hidden;
}

.nav1 .down-menu span {
    margin: 5px 0;
    cursor: pointer;
    transition: all .5s linear;
}

.nav1 .down-menu span:hover {
    color: #000;
    text-shadow: 1px 0px 1px #333;
}

/* 弹窗，遮罩层 */
.zhe{
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 100;
}
.tc{
    background: #e3e8e4;
    width: 320px;
    height: 180px;
    border-radius: 7px;
    font-size: 20px;
    font-family: 'Courier New', Courier, monospace;
    padding: 20px;
    position: absolute; 
    left: 50%;
    top: 50%;
    margin-top: -100px;   /*  高度的一半 */
    margin-left: -140px;    /* 宽度的一半 */

}
form{
    margin-left: 20px;
    
}
input,select,button{
    border: none;
    background-color:#d6d6d6;
    outline: none;  
    border-radius: 6px;
    height: 27px;
}
select{
    width: 90px;
}
form div{
    margin-bottom: 20px;
}

.btn1{
    margin-top: 10px;
    margin-left: 5px;
    padding: 5px;
    width: 100px;
    height: 30px;
    font-size: 20px;
    font-family: 'Courier New', Courier, monospace;
}
.btn1:hover{
    transform: scale(1.2);
    background-color: #fc5531;
}
.btn2{
    background: #98b0b0;
    margin-top: 10px;
    margin-left: 20px;
    padding: 5px;
    width: 100px;
    height: 30px;
    font-size: 20px;
    font-family: 'Courier New', Courier, monospace;
}
.btn2:hover{
    transform: scale(1.2);
    background-color: #4a5954;
}
</style>